@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"
 
echo Current Java Version:
java -version
echo.
echo.
echo.
 
:menu
echo =============================================
echo choose jdk version
echo 1: jdk-1.8.0_211
echo 2: jdk1.8.0_112(x86)
echo 0: cancel
echo =============================================
set /p ch=choose version:
if "%ch%"=="1" gotojdk-1.8.0_211
if "%ch%"=="2" goto jdk1.8.0_112(x86)
if "%ch%"=="0" goto end
goto menu
 
:jdk-1.8.0_211
setx "JAVA_HOME" "C:\Program Files\Java\jdk1.8.0_211" /m
goto end
 
:jdk1.8.0_112(x86)
setx "JAVA_HOME" "C:\Program Files (x86)\Java\jdk1.8.0_112" /m
goto end
 
:end
pause